import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.ticker import MultipleLocator

mpl.rcParams["axes.unicode_minus"] = False

X = [i for i in range(1, 8)]
Y1 = [14.98, 15.31, 14.90, 15.31, 15.51, 17.03, 18.9]
Y2 = [50.12, 50.54, 50.60, 51.60, 50.94, 53.69, 54.7]
Y3 = [67.53, 67.31, 67.66, 66.87, 72.87, 76.73, 82.92]

plt.plot(X, Y1, ls='--', color='g', linewidth=2, marker='D', markersize=8)
plt.plot(X, Y2, ls='--', color='coral', linewidth=2, marker='v', markersize=8)
plt.plot(X, Y3, ls='--', color='teal', linewidth=2, marker='X', markersize=8)
# plt.title('Squares',fontsize=24)
plt.tick_params(axis='both', which='major', labelsize=14)
plt.ylabel(r'Processing latency (us)', fontsize=14)
plt.xlabel('Packet size (bytes)', fontsize=14)
x_major_locator = MultipleLocator(1)
y_major_locator = MultipleLocator(20)
ax = plt.gca()
ax.xaxis.set_major_locator(x_major_locator)
ax.yaxis.set_major_locator(y_major_locator)
plt.xlim(0.5, 7.5)
plt.ylim(0, 100)
# plt.yticks([0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1])
plt.xticks([1, 2, 3, 4, 5, 6, 7], ['64', "128", "256", "512", "1024", "2048", "4016"])
plt.legend(['FW', 'IDS', 'NAT'], frameon=False, fontsize=14, ncol=3)
plt.axhline(y=10, color='lightgray', ls=':', linewidth=1)
plt.axhline(y=20, color='lightgray', ls=':', linewidth=1)
plt.axhline(y=30, color='lightgray', ls=':', linewidth=1)
plt.axhline(y=40, color='lightgray', ls=':', linewidth=1)
plt.axhline(y=50, color='lightgray', ls=':', linewidth=1)
plt.axhline(y=60, color='lightgray', ls=':', linewidth=1)
plt.axhline(y=70, color='lightgray', ls=':', linewidth=1)
plt.axhline(y=80, color='lightgray', ls=':', linewidth=1)
plt.axhline(y=90, color='lightgray', ls=':', linewidth=1)
plt.savefig('types_execution_time.pdf', bbox_inches='tight')
plt.show()
